import type { RouteRecordRaw } from 'vue-router'

/**
 * 错误地址路由
 */
export const COMMON_ROUTES: Array<RouteRecordRaw> =  [
  {
    path: '/:pathMatch(.*)*',
    name: 'loading',
    component: () => import('@/app/public/views/loading.vue'),
    meta: {
      title: '加载中...',
      isHide: true,
    },
  },
  {
    path: '/loading',
    component: () => import('@/app/public/views/loading.vue'),
    meta: {
      title: '加载中...',
      isHide: true,
    },
  },
  {
    path: '/401',
    name: 'noPower',
    component: () => import('@/app/public/views/error/401.vue'),
    meta: {
      title: '没有权限',
      isHide: true,
    },
  },
  {
    path: '/404',
    name: 'notFound',
    component: () => import('@/app/public/views/error/404.vue'),
    meta: {
      title: '找不到此页面',
      isHide: true,
    },
  }
]


/**
 * 定义提前加载界面
 * @link 参考：https://next.router.vuejs.org/zh/guide/essentials/history-mode.html#netlify
 */
export const STATIC_ROUTES: Array<RouteRecordRaw> =  [
    {
      path: '/',
      component: () => import('@app/layout/main/defaults.vue'),
      children: COMMON_ROUTES,
      meta: {
        title: '首页',
        isHide: true,
      },
    },
    {
      path: '/login',
      component: () => import('@app/views/login/index.vue'),
      children: COMMON_ROUTES,
      meta: {
        title: '首页',
        isHide: true,
      },
    },
]


